package com.example.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "mqtt.persistence")
public class MqttPersistenceConfig {
    private MySQL mysql = new MySQL();
    private Redis redis = new Redis();

    @Data
    public static class MySQL {
        private boolean enabled = true;
        private int messageRetentionDays = 7;
        private boolean saveQos0 = false;
    }

    @Data
    public static class Redis {
        private boolean enabled = true;
        private int sessionTimeout = 1800;
    }
} 